// 镜像反射, 只需要关心两个方向
// y方向, 如果碰到界面, 就会反弹, 再反弹.... 最后可以计算出?
// 分多个阶段分析, 没有到最初的右边,  重复N次,  往左走? 往右走

// x方向也可以进行这样的分析;
// 先尝试这样做, 再对照下标准答案

const readline = require("readline");
const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});
let x, y, t;
rl.on("line", (line)=>{
    if(x === undefined) {
        [x, y, t] = line.trim().split(" ").map(Number)
        console.log(getResult(x, y, t))

        x = y = t = undefined
    }

})

function getResult(x, y, t) {
    let sw = 800
    let sh = 600
    let w = 50
    let h = 25
    let resultX = 0
    let resultY = 0
    // x判断出界
    let countX = x + w + t;
    if(countX <=  sw) { // 第一阶段
        resultX = x + t
    } else { // 第二阶段
        countX = t - (sw - (x + w))
        countX = countX % (2 * (sw - w))
        if(countX <= (sw - w)) {
            resultX = sw-w - countX
        } else {
            resultX = countX - (sw-w)
        }
    }
    // y判断出界
    let countY = y + h + t;
    if(countY <=  sh) { // 第一阶段
        resultY = y + t
    } else { // 第二阶段
        countY = t - (sh - (y + h))
        countY = countY % (2 * (sh - h))
        if(countY <= (sh - h)) {
            resultY = sh-h - countY
        } else {
            resultY = countY - (sh-h)
        }
    }
    return `${resultX} ${resultY}`
}